package com.csi.okr.mobile.common.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 
 * 组织信息实体类
 *
 */

@Entity
@Table(name = "V_OKR_ORG", schema = "PSGIS")
public class VOkrOrg implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@JSONField(serialize = false)  
	private String orgUuid;
	private String orgCode;
	@JSONField(serialize = false)  
	private String orgName;
	private String orgZhSname;
	@JSONField(serialize = false)  
	private String orgLevel;
	@JSONField(serialize = false)  
	private String orgParentUuid;
	@JSONField(serialize = false) 
	private Integer orgSeqNum; 

	
	@Id
	@Column(name = "ORG_UUID")
	public String getOrgUuid() {
		return orgUuid;
	}

	public void setOrgUuid(String orgUuid) {
		this.orgUuid = orgUuid;
	}
	
	@Column(name = "ORG_CODE")
	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	@Column(name = "ORG_NAME")
	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	@Column(name = "ORG_ZH_SNAME")
	public String getOrgZhSname() {
		return orgZhSname;
	}

	public void setOrgZhSname(String orgZhSname) {
		this.orgZhSname = orgZhSname;
	}

	@Column(name = "ORG_LEVEL")
	public String getOrgLevel() {
		return orgLevel;
	}

	public void setOrgLevel(String orgLevel) {
		this.orgLevel = orgLevel;
	}

	@Column(name = "ORG_PARENT_UUID")
	public String getOrgParentUuid() {
		return orgParentUuid;
	}

	public void setOrgParentUuid(String orgParentUuid) {
		this.orgParentUuid = orgParentUuid;
	}

	@Column(name = "ORG_SEQ_NUM")
	public Integer getOrgSeqNum() {
		return orgSeqNum;
	}

	public void setOrgSeqNum(Integer orgSeqNum) {
		this.orgSeqNum = orgSeqNum;
	}  
	
    //子菜单列表  
    private List<VOkrOrg> childOrg = new ArrayList<VOkrOrg>();
  
    @OneToMany(targetEntity = VOkrOrg.class, cascade = { CascadeType.ALL },fetch=FetchType.EAGER)  
    @JoinColumn(name = "ORG_PARENT_UUID",referencedColumnName="ORG_UUID",insertable=false, updatable=false)  
    @OrderBy(value="ORG_LEVEL ASC,ORG_SEQ_NUM ASC")
    public List<VOkrOrg> getChildOrg() {  
        return childOrg;  
    }

	public void setChildOrg(List<VOkrOrg> childOrg) {
		this.childOrg = childOrg;
	}

	
    

}
